cmake_minimum_required(VERSION 3.10)

aux_source_directory(src SRC)

add_library(misc SHARED ${SRC}) 

target_link_libraries(misc string)

find_package(CxxTest)
if(CXXTEST_FOUND)
    include_directories(${CXXTEST_INCLUDE_DIR})
    enable_testing()
    CXXTEST_ADD_TEST(test_misc test_misc.cpp 
		${CMAKE_CURRENT_SOURCE_DIR}/test/link_next_simple.hxx
		${CMAKE_CURRENT_SOURCE_DIR}/test/sparce_color.hxx
		${CMAKE_CURRENT_SOURCE_DIR}/test/sparce_map.hxx
		${CMAKE_CURRENT_SOURCE_DIR}/test/link_next.hxx
		${CMAKE_CURRENT_SOURCE_DIR}/test/link_last_next.hxx
		${CMAKE_CURRENT_SOURCE_DIR}/test/runtimestamp.hxx
		${CMAKE_CURRENT_SOURCE_DIR}/test/magic.hxx
		${CMAKE_CURRENT_SOURCE_DIR}/test/magiced_buffer.hxx
		)
	target_link_libraries(test_misc misc)
endif()